<template>
  <view class="bb">
    <button lang="zh_CN" @click="onGotUserInfo">获取用户信息</button>
  </view>
</template>

<script>
export default {
  data() {
    return {};
  },
  methods: {
    onGotUserInfo(e) {
      wx.getUserProfile({
        desc: "用于完善会员资料", // 声明获取用户个人信息后的用途，后续会展示在弹窗中，请谨慎填写
        success: (res) => {
          console.log(res);
          uni.setStorageSync("userinfo", res.userInfo);
          uni.navigateBack({
            delta: 1,
          });
        },
      });
    },
  },
};
</script>

<style lang="scss">
.bb {
  height: 100vh;
  .aa {
    background-color: #007aff;
    position: absolute;
    top: 0px;
    left: 0px;
  }
}
</style>
